#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    string largestNumber(vector<int>& nums) {
        vector<string> str;
        for (auto x : nums) str.push_back(to_string(x));
        sort(str.begin(), str.end(), [](const string& s1, const string& s2)
            {
                return s1 + s2 > s2 + s1;
            });
        string ret;
        for (auto x : str) ret += x;
        if (ret[0] == '0') return "0";
        return ret;
    }
};